Optimal. Leaf size=331 \[ -\frac {\tan ^{-1}\left (\frac {\sqrt {-\sqrt {a}+\sqrt {a+b}}-\sqrt {2} \sqrt [4]{a} x}{\sqrt {\sqrt {a}+\sqrt {a+b}}}\right )}{2 \sqrt {2} a^{3/4} \sqrt {\sqrt {a}+\sqrt {a+b}}}+\frac {\tan ^{-1}\left (\frac {\sqrt {-\sqrt {a}+\sqrt {a+b}}+\sqrt {2} \sqrt [4]{a} x}{\sqrt {\sqrt {a}+\sqrt {a+b}}}\right )}{2 \sqrt {2} a^{3/4} \sqrt {\sqrt {a}+\sqrt {a+b}}}+\frac {\log \left (\sqrt {a+b}-\sqrt {2} \sqrt [4]{a} \sqrt {-\sqrt {a}+\sqrt {a+b}} x+\sqrt {a} x^2\right )}{4 \sqrt {2} a^{3/4} \sqrt {-\sqrt {a}+\sqrt {a+b}}}-\frac {\log \left (\sqrt {a+b}+\sqrt {2} \sqrt [4]{a} \sqrt {-\sqrt {a}+\sqrt {a+b}} x+\sqrt {a} x^2\right )}{4 \sqrt {2} a^{3/4} \sqrt {-\sqrt {a}+\sqrt {a+b}}} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.18, antiderivative size = 331, normalized size of antiderivative = 1.00, number of steps
used = 9, number of rules used = 5, integrand size = 20, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.250, Rules used = {1143, 648, 632,
210, 642} \begin {gather*} -\frac {\text {ArcTan}\left (\frac {\sqrt {\sqrt {a+b}-\sqrt {a}}-\sqrt {2} \sqrt [4]{a} x}{\sqrt {\sqrt {a+b}+\sqrt {a}}}\right )}{2 \sqrt {2} a^{3/4} \sqrt {\sqrt {a+b}+\sqrt {a}}}+\frac {\text {ArcTan}\left (\frac {\sqrt {\sqrt {a+b}-\sqrt {a}}+\sqrt {2} \sqrt [4]{a} x}{\sqrt {\sqrt {a+b}+\sqrt {a}}}\right )}{2 \sqrt {2} a^{3/4} \sqrt {\sqrt {a+b}+\sqrt {a}}}+\frac {\log \left (-\sqrt {2} \sqrt [4]{a} x \sqrt {\sqrt {a+b}-\sqrt {a}}+\sqrt {a+b}+\sqrt {a} x^2\right )}{4 \sqrt {2} a^{3/4} \sqrt {\sqrt {a+b}-\sqrt {a}}}-\frac {\log \left (\sqrt {2} \sqrt [4]{a} x \sqrt {\sqrt {a+b}-\sqrt {a}}+\sqrt {a+b}+\sqrt {a} x^2\right )}{4 \sqrt {2} a^{3/4} \sqrt {\sqrt {a+b}-\sqrt {a}}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 210
Rule 632
Rule 642
Rule 648
Rule 1143
Rubi steps
\begin {align*} \int \frac {x^2}{a+b+2 a x^2+a x^4} \, dx &=\frac {\int \frac {x}{\frac {\sqrt {a+b}}{\sqrt {a}}-\frac {\sqrt {2} \sqrt {-\sqrt {a}+\sqrt {a+b}} x}{\sqrt [4]{a}}+x^2} \, dx}{2 \sqrt {2} a^{3/4} \sqrt {-\sqrt {a}+\sqrt {a+b}}}-\frac {\int \frac {x}{\frac {\sqrt {a+b}}{\sqrt {a}}+\frac {\sqrt {2} \sqrt {-\sqrt {a}+\sqrt {a+b}} x}{\sqrt [4]{a}}+x^2} \, dx}{2 \sqrt {2} a^{3/4} \sqrt {-\sqrt {a}+\sqrt {a+b}}}\\ &=\frac {\int \frac {1}{\frac {\sqrt {a+b}}{\sqrt {a}}-\frac {\sqrt {2} \sqrt {-\sqrt {a}+\sqrt {a+b}} x}{\sqrt [4]{a}}+x^2} \, dx}{4 a}+\frac {\int \frac {1}{\frac {\sqrt {a+b}}{\sqrt {a}}+\frac {\sqrt {2} \sqrt {-\sqrt {a}+\sqrt {a+b}} x}{\sqrt [4]{a}}+x^2} \, dx}{4 a}+\frac {\int \frac {-\frac {\sqrt {2} \sqrt {-\sqrt {a}+\sqrt {a+b}}}{\sqrt [4]{a}}+2 x}{\frac {\sqrt {a+b}}{\sqrt {a}}-\frac {\sqrt {2} \sqrt {-\sqrt {a}+\sqrt {a+b}} x}{\sqrt [4]{a}}+x^2} \, dx}{4 \sqrt {2} a^{3/4} \sqrt {-\sqrt {a}+\sqrt {a+b}}}-\frac {\int \frac {\frac {\sqrt {2} \sqrt {-\sqrt {a}+\sqrt {a+b}}}{\sqrt [4]{a}}+2 x}{\frac {\sqrt {a+b}}{\sqrt {a}}+\frac {\sqrt {2} \sqrt {-\sqrt {a}+\sqrt {a+b}} x}{\sqrt [4]{a}}+x^2} \, dx}{4 \sqrt {2} a^{3/4} \sqrt {-\sqrt {a}+\sqrt {a+b}}}\\ &=\frac {\log \left (\sqrt {a+b}-\sqrt {2} \sqrt [4]{a} \sqrt {-\sqrt {a}+\sqrt {a+b}} x+\sqrt {a} x^2\right )}{4 \sqrt {2} a^{3/4} \sqrt {-\sqrt {a}+\sqrt {a+b}}}-\frac {\log \left (\sqrt {a+b}+\sqrt {2} \sqrt [4]{a} \sqrt {-\sqrt {a}+\sqrt {a+b}} x+\sqrt {a} x^2\right )}{4 \sqrt {2} a^{3/4} \sqrt {-\sqrt {a}+\sqrt {a+b}}}-\frac {\text {Subst}\left (\int \frac {1}{-2 \left (1+\frac {\sqrt {a+b}}{\sqrt {a}}\right )-x^2} \, dx,x,-\frac {\sqrt {2} \sqrt {-\sqrt {a}+\sqrt {a+b}}}{\sqrt [4]{a}}+2 x\right )}{2 a}-\frac {\text {Subst}\left (\int \frac {1}{-2 \left (1+\frac {\sqrt {a+b}}{\sqrt {a}}\right )-x^2} \, dx,x,\frac {\sqrt {2} \sqrt {-\sqrt {a}+\sqrt {a+b}}}{\sqrt [4]{a}}+2 x\right )}{2 a}\\ &=-\frac {\tan ^{-1}\left (\frac {\sqrt {-\sqrt {a}+\sqrt {a+b}}-\sqrt {2} \sqrt [4]{a} x}{\sqrt {\sqrt {a}+\sqrt {a+b}}}\right )}{2 \sqrt {2} a^{3/4} \sqrt {\sqrt {a}+\sqrt {a+b}}}+\frac {\tan ^{-1}\left (\frac {\sqrt {-\sqrt {a}+\sqrt {a+b}}+\sqrt {2} \sqrt [4]{a} x}{\sqrt {\sqrt {a}+\sqrt {a+b}}}\right )}{2 \sqrt {2} a^{3/4} \sqrt {\sqrt {a}+\sqrt {a+b}}}+\frac {\log \left (\sqrt {a+b}-\sqrt {2} \sqrt [4]{a} \sqrt {-\sqrt {a}+\sqrt {a+b}} x+\sqrt {a} x^2\right )}{4 \sqrt {2} a^{3/4} \sqrt {-\sqrt {a}+\sqrt {a+b}}}-\frac {\log \left (\sqrt {a+b}+\sqrt {2} \sqrt [4]{a} \sqrt {-\sqrt {a}+\sqrt {a+b}} x+\sqrt {a} x^2\right )}{4 \sqrt {2} a^{3/4} \sqrt {-\sqrt {a}+\sqrt {a+b}}}\\ \end {align*}
________________________________________________________________________________________
Mathematica [C] Result contains complex when optimal does not.
time = 0.08, size = 143, normalized size = 0.43 \begin {gather*} \frac {\frac {\left (i \sqrt {a}+\sqrt {b}\right ) \tan ^{-1}\left (\frac {\sqrt {a} x}{\sqrt {a-i \sqrt {a} \sqrt {b}}}\right )}{\sqrt {a-i \sqrt {a} \sqrt {b}}}+\frac {\left (-i \sqrt {a}+\sqrt {b}\right ) \tan ^{-1}\left (\frac {\sqrt {a} x}{\sqrt {a+i \sqrt {a} \sqrt {b}}}\right )}{\sqrt {a+i \sqrt {a} \sqrt {b}}}}{2 \sqrt {a} \sqrt {b}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.05, size = 339, normalized size = 1.02
method | result | size |
risch | \(\frac {\munderset {\textit {\_R} =\RootOf \left (a \,\textit {\_Z}^{4}+2 a \,\textit {\_Z}^{2}+a +b \right )}{\sum }\frac {\textit {\_R}^{2} \ln \left (x -\textit {\_R} \right )}{\textit {\_R}^{3}+\textit {\_R}}}{4 a}\) | \(41\) |
default | \(\frac {\sqrt {2 \sqrt {a^{2}+a b}-2 a}\, \left (\sqrt {a^{2}+a b}+a \right ) \left (\frac {\ln \left (-x^{2} \sqrt {a}+x \sqrt {2 \sqrt {a \left (a +b \right )}-2 a}-\sqrt {a +b}\right )}{2 \sqrt {a}}-\frac {\sqrt {2 \sqrt {a \left (a +b \right )}-2 a}\, \arctan \left (\frac {-2 x \sqrt {a}+\sqrt {2 \sqrt {a \left (a +b \right )}-2 a}}{\sqrt {4 \sqrt {a}\, \sqrt {a +b}-2 \sqrt {a \left (a +b \right )}+2 a}}\right )}{\sqrt {a}\, \sqrt {4 \sqrt {a}\, \sqrt {a +b}-2 \sqrt {a \left (a +b \right )}+2 a}}\right )}{4 a b}-\frac {\sqrt {2 \sqrt {a^{2}+a b}-2 a}\, \left (\sqrt {a^{2}+a b}+a \right ) \left (\frac {\ln \left (x^{2} \sqrt {a}+x \sqrt {2 \sqrt {a \left (a +b \right )}-2 a}+\sqrt {a +b}\right )}{2 \sqrt {a}}-\frac {\sqrt {2 \sqrt {a \left (a +b \right )}-2 a}\, \arctan \left (\frac {2 x \sqrt {a}+\sqrt {2 \sqrt {a \left (a +b \right )}-2 a}}{\sqrt {4 \sqrt {a}\, \sqrt {a +b}-2 \sqrt {a \left (a +b \right )}+2 a}}\right )}{\sqrt {a}\, \sqrt {4 \sqrt {a}\, \sqrt {a +b}-2 \sqrt {a \left (a +b \right )}+2 a}}\right )}{4 a b}\) | \(339\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.35, size = 279, normalized size = 0.84 \begin {gather*} \frac {1}{4} \, \sqrt {\frac {a b \sqrt {-\frac {1}{a^{3} b}} + 1}{a b}} \log \left (a^{2} b \sqrt {\frac {a b \sqrt {-\frac {1}{a^{3} b}} + 1}{a b}} \sqrt {-\frac {1}{a^{3} b}} + x\right ) - \frac {1}{4} \, \sqrt {\frac {a b \sqrt {-\frac {1}{a^{3} b}} + 1}{a b}} \log \left (-a^{2} b \sqrt {\frac {a b \sqrt {-\frac {1}{a^{3} b}} + 1}{a b}} \sqrt {-\frac {1}{a^{3} b}} + x\right ) - \frac {1}{4} \, \sqrt {-\frac {a b \sqrt {-\frac {1}{a^{3} b}} - 1}{a b}} \log \left (a^{2} b \sqrt {-\frac {a b \sqrt {-\frac {1}{a^{3} b}} - 1}{a b}} \sqrt {-\frac {1}{a^{3} b}} + x\right ) + \frac {1}{4} \, \sqrt {-\frac {a b \sqrt {-\frac {1}{a^{3} b}} - 1}{a b}} \log \left (-a^{2} b \sqrt {-\frac {a b \sqrt {-\frac {1}{a^{3} b}} - 1}{a b}} \sqrt {-\frac {1}{a^{3} b}} + x\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A]
time = 0.26, size = 44, normalized size = 0.13 \begin {gather*} \operatorname {RootSum} {\left (256 t^{4} a^{3} b^{2} - 32 t^{2} a^{2} b + a + b, \left ( t \mapsto t \log {\left (64 t^{3} a^{2} b - 4 t a + x \right )} \right )\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 3.44, size = 203, normalized size = 0.61 \begin {gather*} -\frac {{\left (3 \, \sqrt {a^{2} + \sqrt {-a b} a} \sqrt {-a b} a + 4 \, \sqrt {a^{2} + \sqrt {-a b} a} \sqrt {-a b} b\right )} {\left | a \right |} \arctan \left (\frac {2 \, \sqrt {\frac {1}{2}} x}{\sqrt {\frac {2 \, a + \sqrt {-4 \, {\left (a + b\right )} a + 4 \, a^{2}}}{a}}}\right )}{2 \, {\left (3 \, a^{4} b + 4 \, a^{3} b^{2}\right )}} + \frac {{\left (3 \, \sqrt {a^{2} - \sqrt {-a b} a} \sqrt {-a b} a + 4 \, \sqrt {a^{2} - \sqrt {-a b} a} \sqrt {-a b} b\right )} {\left | a \right |} \arctan \left (\frac {2 \, \sqrt {\frac {1}{2}} x}{\sqrt {\frac {2 \, a - \sqrt {-4 \, {\left (a + b\right )} a + 4 \, a^{2}}}{a}}}\right )}{2 \, {\left (3 \, a^{4} b + 4 \, a^{3} b^{2}\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.28, size = 222, normalized size = 0.67 \begin {gather*} -2\,\mathrm {atanh}\left (\frac {2\,\left (x\,\left (4\,a^2\,b-4\,a^3\right )+\frac {4\,a\,x\,\left (\sqrt {-a^3\,b^3}+a^2\,b\right )}{b}\right )\,\sqrt {\frac {\sqrt {-a^3\,b^3}+a^2\,b}{16\,a^3\,b^2}}}{2\,a^2+2\,b\,a}\right )\,\sqrt {\frac {\sqrt {-a^3\,b^3}+a^2\,b}{16\,a^3\,b^2}}-2\,\mathrm {atanh}\left (\frac {2\,\left (x\,\left (4\,a^2\,b-4\,a^3\right )-\frac {4\,a\,x\,\left (\sqrt {-a^3\,b^3}-a^2\,b\right )}{b}\right )\,\sqrt {-\frac {\sqrt {-a^3\,b^3}-a^2\,b}{16\,a^3\,b^2}}}{2\,a^2+2\,b\,a}\right )\,\sqrt {-\frac {\sqrt {-a^3\,b^3}-a^2\,b}{16\,a^3\,b^2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________